<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="customerTemplate.xhtml">

    <ui:define name="contentCustomer">
        <h1>Customer Register</h1>
        <h:messages showDetail="true"/>
        <h:form>
        <table>
            <tr>
                <td><h:outputLabel for="loginname" value="User Login: " /></td>
                <td><h:inputText id="loginname" value="#{customerCreate.customerToCreate.login}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="password" value="Password: "/></td>
                <td><p:password id="password" value="#{customerCreate.customerToCreate.password}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="firstname" value="First name: "/></td>
                <td><h:inputText id="firstname" value="#{customerCreate.customerToCreate.firstName}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="lastname" value="Last Name: "/></td>
                <td><h:inputText id="lastname" value="#{customerCreate.customerToCreate.lastName}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="customergroup" value="Customer Group: "/></td>
                <td>
                    <h:selectOneMenu id="customergroup" value="#{customerCreate.selectedCustomerGroup}">
                       <f:selectItems value="#{customerCreate.availableCustomerGroups}" />
                    </h:selectOneMenu>
                </td>
            </tr>
            <tr>

                <!--Maybe automaticaly set to false until admin confirms?-->
                
                <td><h:outputLabel for="enabled" value="Enabled: "/></td>
                <td><h:selectBooleanCheckbox id="enabled" value="#{customerCreate.customerToCreate.enabled}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="description" value="Description(optional): "/></td>
                <td>
                    <h:inputTextarea id="description" value="#{customerCreate.customerToCreate.description}"/>
                </td>
            </tr>
        </table>
        <p:growl id="message" showDetail="true"/>
        <p:commandButton value="Register" actionListener="#{customerCreate.createCustomer}" update="message"/>
        </h:form>
    </ui:define>

</ui:composition>
        